// FinanceManager.java

public class FinanceManager{

    // 记录收入
    public void recordIncome(double amount) {
        System.out.println("记录收入: " + amount + " 元");
    }

    // 记录支出
    public void recordExpense(double amount) {
        System.out.println("记录支出: " + amount + " 元");
    }

// 查看所有账单
    public void viewAllBills() {
        System.out.println("所有账单:");
        for (Bill bill : bills) {
            System.out.println(bill);
        }
    }

    // 查询账单（按类型）
    public void queryBills(String type) {
        System.out.println("查询 " + type + " 账单:");
        for (Bill bill : bills) {
            if (bill.getType().equals(type)) {
                System.out.println(bill);
            }
        }
    }

 // 设置预算
    public void setBudget() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入每月预算限额: ");
        monthlyBudget = scanner.nextDouble();
        System.out.println("当前预算设置为: " + monthlyBudget);
    }

    // 检查剩余预算
    public void checkRemainingBudget() {
        double remainingBudget = monthlyBudget - totalExpense;
        System.out.printf("当前剩余可用预算: %.2f%n", remainingBudget);
    }

    // 月度统计
    public void monthlyStatistics() {
        System.out.println("本月总收入: " + totalIncome);
        System.out.println("本月总支出: " + totalExpense);
    }


    // 主方法，用于测试
    public static void main(String[] args) {
        FinanceManager manager = new FinanceManager();
        manager.recordIncome(1000.0);
        manager.recordExpense(500.0);
    }
}